package org.luxor.commons.workflow.listener;

import org.activiti.engine.delegate.event.ActivitiEntityEvent;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 分配任务办理人
 *
 * @author Mr.yan  @date 2021/10/27
 */
public class TaskAssignedListener implements ActivitiEventHandler {

    private static final Logger log = LoggerFactory.getLogger(TaskAssignedListener.class);

    @Override
    public void handle(ActivitiEvent event) {
        ActivitiEntityEvent entityEvent = (ActivitiEntityEvent) event;
        TaskEntity taskEntity = (TaskEntity) entityEvent.getEntity();
        log.debug("任务分配办理人(TaskAssignedListener). TaskId: " + taskEntity.getId() + "(" + taskEntity.getName()
                + "),ProcInstId: " + entityEvent.getProcessInstanceId()
                + ",ExecutionId: " + taskEntity.getExecutionId()
                + ",Assignee: " + taskEntity.getAssignee());
    }
}
